<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="st" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'home.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type="text/javascript">
		function startTime()
		{
		var today=new Date()
		var day = today.toDateString()
		var time= today.toLocaleTimeString()

		document.getElementById('clock').innerHTML=time+" "+day
		t=setTimeout('startTime()',500)
		}
	</script>
  </head>
  
  <body onload="startTime()">
		<div id="clock"></div>
		
		<center>
  		<h4>当前能接收到数据的主机</h4>
  		<h5>已注册的主机</h5>
    	 <table cellspacing="40px">
  			<tr>
  				<th>名称</th><th>IP</th><th>备注</th><th>是否忽略</th>
  			</tr>
  			<st:iterator value="activeRegistedServers" var="rs">
	  			<tr>
  					<td><st:property value="#rs.name"/></td>
  					<td><st:property value="#rs.IP"/></td>
  					<td><st:property value="#rs.notes"/></td>
  					<td><st:if test="#rs.ignored">是</st:if><st:else>否</st:else></td>
  				</tr>
  			</st:iterator>
  		</table>
  			<st:debug></st:debug>
  		 <h5>未知的主机</h5>
    	 <table>
  			<tr>
  				<th>IP</th>
  			</tr>
  			<st:iterator value="activeUnknownServers" var="s">
	  			<tr>
  					<td><st:property value="#s.IP"/></td>
  				</tr>
  			</st:iterator>
 		</table>
 		</center>
 		
  </body>
</html>
